#import <Foundation/Foundation.h>
#import "EventViewer.h"
#import "SFUConstants.h"

/**
 * An EventListViewer is an object representing the view that 
 * displays a list of events with partial headings and descriptions.
 *
 * An EventViewerDelegate must be set to respond to events from
 * within the inner event viewer.
 *
 * Conforms to the EventViewerDelegate protocol.
 *
 * @author      James Lin
 * @version     0.8.10
 * @since       0.2.3
 * @see         EventViewerDelegate
 * @see         EventViewer
 */
@interface EventListViewer : UIViewController <UITableViewDelegate, UITableViewDataSource, 
												EventViewerDelegate> {
	id<EventViewerDelegate> delegate;       // Delegate handling events from inner event viewer
	NSMutableArray*         eventInfoList;  // Data source for the table of event listings
	UITableView*            eventTableView; // Table of event listings
	UINavigationController* parentNav;      // Navigation controller of the parent view
}

/**
 * Retrieve the shared instance of the event list viewer.
 *
 * @return  the shared instance of EventListViewer
 */
+ (EventListViewer*)sharedEventListViewer;

/**
 * Get the delegate handling events from the inner event viewer.
 *
 * @return  the delegate handling events from the inner event viewer
 * @see     EventViewerDelegate
 * @see     EventViewer
 */
- (id<EventViewerDelegate>)delegate;

/**
 * Set the delegate handling events from the inner event viewer.
 *
 * param theDelegate  the delegate handling events from the inner event viewer
 * @see               EventViewerDelegate
 * @see               EventViewer
 */
- (void)setDelegate:(id<EventViewerDelegate>)theDelegate;

/**
 * Display the listing of events in a new view.
 *
 * Pushes this view onto the navigation controller stack of the parent
 * view. Upon tapping the back button, the view is automatically 
 * popped off the top of the navigation stack.
 *
 * @param eventList      the list of events to display
 * @param navController  the navigation controller of the parent view
 */
- (void)displayEventList:(NSArray*)eventList 
		   navController:(UINavigationController*)navController;

@end
